#include <iostream>
#include <conio.h>

int main(){

	double result = 2.0;
	double sum = 0.0;
	double mean = 0.0;
	int count = 0;

	std::cout << "if you want exit and take mean press 0" << std::endl;
	while(0 != result ){
		
		std::cout << count + 1 << "number = ";
		std::cin >> result;	
		if(0 != result){
			sum += result ;
			count++;
		}

	}
	mean = sum / (double)count ;
	std::cout << "mean = " << mean << std::endl;
	getch();

	return 0;
}